<?php
// debug($students);
?>
<div class="students index">
<h2><?php __('Список студентов 1 курса из области '.$students[0]['Region']['name']);?></h2>
<p>
<?php
/*debug ($courses);
debug ($studentgroups);
debug ($students);*/

?></p>
<table cellpadding="0" cellspacing="0" class="art-article">
<tr>
	<th>№</th>
	<th>Факультет группа курс</th>
	<th>ФИО</th>
	<th>Адрес места жительства</th>

</tr>
<?php
$i = 1;
foreach ($students as $student):
?>
	<tr>
		<td>
			<?php echo $i; ?>
		</td>
		<td>
			<?php 
			echo $facultets[$courses[$studentgroups[$student['Student']['studentgroup_id']-1]['Course']['id']-1]['Profession']['facultet_id']].' ';
			echo $studentgroups[$student['Student']['studentgroup_id']-1]['Course']['name'].' ';
			echo $studentgroups[$student['Student']['studentgroup_id']-1]['Studentgroup']['name'];
/*			echo $facultets[$courses[$student['Studentgroup']['course_id']-1]['Profession']['facultet_id']].' ';
			$courses[$student['Studentgroup']['course_id']-1]['Profession']['name'].' '; 
			echo $courses[$student['Studentgroup']['course_id']-1]['Course']['name'].' ';
			echo $student['Studentgroup']['name'].' ';
*/			?>
		</td>		
		<td>
			<?php 	echo $student['Student']['lastname'].' ';
					echo $student['Student']['firstname'].' ';
					echo $student['Student']['surname'].' ';
			?>
		</td>				
		<td>
			<?php 	
					echo $student['Studentinfo']['passport_adress'];
			?>
		</td>	
	</tr>
<?php
	$i++; 
	endforeach; 
?>
</table>
</div>